<%@ page language="java" import="java.io.*,java.util.*,java.sql.*,eSat.*"%>
<%@include file="../../dbcon.jsp"%>

<%
	String sHtml = "";
try
{

	String sTblName	= "tbl_teachers_master";
	String sTblCon	= "status=1";
	String sQry		= "";
	
	if ( request.getParameter("TblName") != null )
		sTblName	= request.getParameter("TblName");
	if ( request.getParameter("q") != null )
		sTblCon	+= " and teacher_name like '"+ request.getParameter("q") + "%'";

	sQry ="select * from "+ sTblName +" where "+ sTblCon +" order by teacher_name";
System.out.println(sQry);		
	Statement Stmt = Con.createStatement();
	ResultSet Rs = Stmt.executeQuery(sQry);
	while(Rs.next())
	{
		sHtml += Rs.getString("teacher_name") +"|"+ Rs.getString("teacherid") +"\n";
	}
	Rs.close();
	Stmt.close();
	if ( Con != null ) Con.close();

	response.getWriter().write(sHtml);
}
catch(Exception e)
{ 
	System.out.println(e);
	response.getWriter().write(sHtml);
}
%>
